<template>
    <div>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <i class="el-icon-lx-calendar"></i> 部门信息
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            {{deptInfo}}
        </div>
        <el-divider></el-divider>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <i class="el-icon-user"></i> 部门经理:  <strong>{{deptManager}}</strong>
                </el-breadcrumb-item>
            </el-breadcrumb>
             
        </div>
        <el-divider></el-divider>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <i class="el-icon-user"></i> 员工信息
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <el-table
                :data="deptEmployee"
                border
                class="table"
                ref="multipleTable"
                header-cell-class-name="table-header"
                @selection-change="handleSelectionChange"
            >
                <el-table-column type="selection" width="55" align="center"></el-table-column>
                <el-table-column type="index" label=工号 width="55" align="center"></el-table-column>
                <el-table-column prop="name" label="员工姓名" width="100" align="center"></el-table-column>
                <el-table-column prop="gender" label="性别" width="70" align="center"></el-table-column>
                <el-table-column prop="birthday" label="出生日期" width="150" align="center"></el-table-column>
                <el-table-column prop="idCard" label="身份证号码" width="200" align="center"></el-table-column> 
                <el-table-column prop="nationId" label="民族" width="70" align="center"></el-table-column> 
                <el-table-column prop="nativePlace" label="籍贯" width="70" align="center"></el-table-column>
                <el-table-column prop="politicId" label="政治面貌" width="80" align="center"></el-table-column>
                <el-table-column prop="email" label="邮箱" width="200" align="center"></el-table-column>
                <el-table-column prop="phone" label="电话号码" width="150" align="center"></el-table-column>
                <el-table-column prop="address" label="地址" width="100" align="center"></el-table-column>
                <!-- <el-table-column prop="deptId" label="所属部门"></el-table-column> -->
                <el-table-column prop="posId" label="职位"></el-table-column>
                <el-table-column prop="topDegree" label="最高学历" width="80" align="center"></el-table-column>
                <el-table-column prop="school" label="毕业院校" width="150" align="center"></el-table-column> 
                <el-table-column prop="beginData" label="入职日期"></el-table-column>    
                <el-table-column prop="endContract" label="终止日期"></el-table-column>    
                
                <el-table-column label="操作" width="180" align="center">
                    <template slot-scope="scope">
                        <el-button
                            type="text"
                            icon="el-icon-edit"
                            @click="handleEdit(scope.$index, scope.row ,scope.row.id)"
                        >编辑</el-button>
                        <el-button
                            type="text"
                            icon="el-icon-delete"
                            class="red"
                            @click="handleDelete(scope.$index, scope.row ,scope.row.id)"
                        >删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
    </div>
</template>

<script>
export default {
    name: "deptInfo",
    data() {
        return {
            deptManager: '',
            deptInfo: '',
            deptName: '',
            deptEmployee: []
        }
    },
    created() {
        this.init()
    },
    watch: {
        // 路由监听，路由发生变化，方法就会执行
        $route(to, from) {
            this.init()
        }
    },
    methods: {
        init() {
            this.deptManager = this.$route.params.deptManager,
            this.deptInfo = this.$route.params.deptInfo,
            this.deptName = this.$route.params.deptName,
            this.deptEmployee = this.$route.params.deptEmployee
        }
    }

}
</script>

<style scoped>

</style>